package org.ricks.log;

/**
 * @author chenwei
 * @Title:
 * @Package
 * @Description:
 * @date 2021/1/2917:13
 */
final class PlainTextSegment implements Segment {

    private final String text;

    /**
     * @param text
     *            Plain static text
     */
    PlainTextSegment(final String text) {
        this.text = text;
    }

    @Override
    public String getStaticText() {
        return text;
    }

    @Override
    public boolean validateToken(final String token) {
        return text.equals(token);
    }

    @Override
    public String createToken(final String prefix, final Timestamp timestamp) {
        return text;
    }

}